<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:winter="http://www.winter.org">
<body>
	<div th:fragment="datoComp">
		<winter:output id="CrearEditarDatoCOutput">
			<div id="BarraNuevoDatoC" class="form-container" th:if="${datosComp.context.datoComp}">
				<div class="form-title" th:text="@{'Dato Complementario'}">Dato Complementario</div>
				<winter:row>
					<winter:column type="col-md-4">
						<winter:inputtext id="NuevoDatoCodigo" field="*{dato.codigo}"
							label="#{label.common.codigo}" maxlength="20"
							required="true" requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.codigo.requerido}" type="char"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text">
						</winter:inputtext>
						<winter:inputtext id="NuevoDatoDescripcion"
							field="*{dato.descripcion}" maxlength="200"
							label="#{label.common.descripcion}" required="true"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.descripcion.requerido}"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text p300">
						</winter:inputtext>
						<winter:select id="selectTipoDato" field="*{dato.tipoDato}"
							collection="tiposD, rowTiposD : ${datosComp.tipos}"
							value="${tiposD.id}" text="@{${tiposD.descripcion}}"
							label="@{'Tipo Dato: '}" required="true"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="Favor seleccione un tipo de Dato" modern="true">
						</winter:select>
					</winter:column>
					<winter:column type="col-md-4">
						<winter:inputtext id="NuevoDatoCLongitud" field="*{dato.longitud}"
							label="@{'Longitud: '}" required="true" type="float"
							requiredimage="/images/icons/exclamation-small-red.png"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:inputtext>
						<winter:inputtext id="NuevoDatoCPrecision"
							field="*{dato.precisiondato}" type="float" 
							label="@{'Precision: '}" required="false"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.numero.requerido}"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:inputtext>
						<winter:inputtext id="NuevoDatoMascara" field="*{dato.mascara}"
							label="@{'Mascara: '}" maxlength="20"
							required="false"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:inputtext>
					</winter:column>
					<winter:column type="col-md-4">
						<!-- <winter:check id="nuevoDatoCompUsaLv"
							field="*{dato.usaListaDeValores}" display="table-cell"
							label="@{'Usa lista de Valores: '}"
							containerdisplay="table-cell-align-top">
						</winter:check>
						<winter:event id="EventUsaLv" event="change"
							target="nuevoDatoCompUsaLv" url="@{'/datosComp/usaLvEvent'}"
							form="DatosCForm" update="DatosCOutput" object="datosComp"
							immediate="true">
						</winter:event> -->
						<winter:check
							id="@{'nuevoDatoCompUsaLv'}" 
							form="DatosCForm"
							object="datosComp"
							url="@{'/datosComp/usaLvEvent'}"
							field="*{dato.usaListaDeValores}" 
							label="@{'Usa lista de Valores:'}"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							update="CrearEditarDatoCOutput">
						</winter:check>
						<winter:inputtext id="NuevoDatolv"
							disabled="${!datosComp.dato.usaListaDeValores}"
							field="*{dato.listadevalor}"
							label="@{'Lista de valores: '}"
							required="false" maxlength="20"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:inputtext>
						<winter:check id="nuevoDatoCompActivo" field="*{dato.activo}"
							label="@{'Activo: '}"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:check>
					</winter:column>
				</winter:row>
				<winter:row class="button-panel-right" padded="true">
					<winter:ajaxSubmit id="CrearDatoComp" form="DatosCForm"
						url="@{'/datosComp/guardarDatoComp'}"
						update="DatosCOutput, CrearEditarDatoCOutput" object="datosComp"
						value="#{label.operaciones.guardar}" showstatus="true"
						class="btn btn-cyan" confirmationrequired="true"
						confirmationtext="Está seguro que desea realizar la operación?"
						process="BarraNuevoDatoC">
					</winter:ajaxSubmit>
					<winter:ajaxSubmit id="CrearDatoCCancelar" form="DatosCForm"
						url="@{'/datosComp/cancelar'}" update="DatosCOutput"
						value="#{label.operaciones.cancelar}" showstatus="true"
						class="btn btn-danger" process="BarraNuevoDatoC"
						immediate="true">
					</winter:ajaxSubmit>
				</winter:row>
			</div>
		</winter:output>
	</div>
</body>
</html>